/*Copyright Scand LLC http://www.scbr.com
This version of Software is free for using in GPL applications. For non-GPL use please contact info@scbr.com to obtain license*/

function testonchange(userid){
    var gggobj=document.getElementById(userid);
	var iii=gggobj.options.selectedIndex;
	var temp=gggobj.options[iii].text;
	if(temp=="Add"){
		  document.getElementById("iii").setAttribute("src","/DhtmlXGridWebXListSplitDemoHSQL/test2.jsp");
	}
	if(temp=="Update"){
          document.getElementById("iii").setAttribute("src","/DhtmlXGridWebXListSplitDemoHSQL/test3.jsp");
	}
	if(temp=="Delete"){
           alert("userid = "+userid);
	}
}




function eXcell_select1(cell){this.cell = cell;this.grid = this.cell.parentNode.grid;this.edit = function(){};this.getValue = function(){if(this.cell.firstChild.getAttribute)return this.cell.firstChild.innerHTML+"^"+this.cell.firstChild.getAttribute("href")
 else
 return "";};
 this.setValue = function(val){var valsAr = val.split("^");if(valsAr.length==1)valsAr[1] = "";else{if(valsAr.length>1){valsAr[1] = "href='"+valsAr[1]+"'";if(valsAr.length==3)valsAr[1]+= " target='"+valsAr[2]+"'";else
 valsAr[1]+= " target='_blank'";};};
 this.setCValue("<select id=\""+valsAr[0]+"\" onchange=\"testonchange('"+valsAr[0]+"');\"><option>Add</option><option>Update</option><option>Delete</option></select>",valsAr);
 };};eXcell_select1.prototype = new eXcell;eXcell_select1.prototype.getTitle=function(){var z=this.cell.firstChild;return ((z&&z.tagName)?z.getAttribute("href"):"");};eXcell_select1.prototype.getContent=function(){var z=this.cell.firstChild;return ((z&&z.tagName)?z.innerHTML:"");};


function eXcell_link(cell){
	this.cell = cell;
	this.grid = this.cell.parentNode.grid;
	this.edit = function(){};
	this.getValue = function(){
	if(this.cell.firstChild.getAttribute)
		   return this.cell.firstChild.innerHTML+"^"+this.cell.firstChild.getAttribute("href")
    else
           return "";
    };
	this.setValue = function(val){
		var valsAr = val.split("^");
		if(valsAr.length==1)
		   valsAr[1] = "";
		else{
			if(valsAr.length>1){

				valsAr[1] = "href='"+valsAr[1]+"'";
				if(valsAr.length==3){

				    valsAr[1]+= " target='"+valsAr[2]+"'";
				}else{

	               valsAr[1]+= " target='_blank'";
				  //valsAr[1] = "href='#'";
				}
			};
		};
		//this.setCValue("<a "+valsAr[1]+" onclick='(isIE()-event-arguments[0]).cancelBubble = true;'>"+valsAr[0]+"</a>",valsAr);
		var tempvalue=encodeURIComponent(valsAr[0]);
		this.setCValue("<a "+valsAr[1]+" onclick='javascript-{document.getElementById(/-iii/-).setAttribute(/-src/-,/-/DhtmlXGridWebXListSplitDemoHSQL/test.jsp-testargu=-+tempvalue+---);};' return false;>"+valsAr[0]+"</a>");

	};
};
eXcell_link.prototype = new eXcell;
eXcell_link.prototype.getTitle=function(){
	var z=this.cell.firstChild;
	return ((z&&z.tagName)?z.getAttribute("href"):"");
};
eXcell_link.prototype.getContent=function(){
	var z=this.cell.firstChild;return ((z&&z.tagName)?z.innerHTML:"");
};
